package com.yindian.cos.easy.security.controller;

import com.yindian.cos.easy.security.authentication.token.Token;
import com.yindian.cos.easy.security.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 测试controller
 *
 * @author zhangchuanhao
 * @create 2018/11/20
 */
@Controller
public class TestController {

    @RequestMapping(value = {"", "/", "/login"})
    public String login() {
        return "login";
    }

    @RequestMapping("/login-success")
    public String loginSuccess(User user, Token token, Model model) {
        model.addAttribute("user", user);
        model.addAttribute("token", token);
        return "login-success";
    }
}
